//
//  WheelView.m
//  绘图
//
//  Created by 吴志勇 on 2020/3/27.
//  Copyright © 2020 wzy. All rights reserved.
//

#import "WheelView.h"

@interface WheelView()

/*  */
@property (nonatomic, strong) CADisplayLink *link;

@end

@implementation WheelView

- (CADisplayLink *)link{
    if (_link == nil) {
        CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(run)];
        [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
        _link = link;
    }
    
    return _link;
}

-(void)test{
    self.link.paused = NO;//开始定时器
    self.link.paused = YES;//暂停定时器
    
}


+(WheelView *)Wheel{
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
    }
    return self;
}


@end
